﻿// yglz.cpp: 实现文件
//

#include "pch.h"
#include "HoManSys1.h"
#include "yglz.h"
#include "afxdialogex.h"
#include "ADOconnection.h"

// yglz 对话框
ADOconnection con4;
IMPLEMENT_DYNAMIC(yglz, CDialogEx)

yglz::yglz(CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_yglz, pParent)
	, m_lzid(_T(""))
{

}

yglz::~yglz()
{
}

void yglz::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_EDIT1, m_lzid);
}


BEGIN_MESSAGE_MAP(yglz, CDialogEx)
	ON_BN_CLICKED(IDC_BUTTON1, &yglz::OnBnClickedButton1)
END_MESSAGE_MAP()


// yglz 消息处理程序


void yglz::OnBnClickedButton1()
{
	// TODO: 在此添加控件通知处理程序代码
	con4.DBConnection();
	UpdateData();
	CString str = _T("delete  from staff where staffID='" + m_lzid + "'");
	_variant_t RecordsAffected;
	con4.m_pCon->Execute(_bstr_t(str), &RecordsAffected, adCmdText);
	MessageBox(_T("员工已离职！"));
}
